﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class UILogin : UIBase {

    private InputField input_name;
    private InputField input_password;
    private Button btn_ok;
    private Button btn_cancel;

    protected override void InitUI()
    {
        base.InitUI();

        input_name = transform.Find("Obj/UserNameInput").GetComponent<InputField>();
        input_password = transform.Find("Obj/PasswordInput").GetComponent<InputField>();
        btn_ok = transform.Find("Obj/Btn_Ok").GetComponent<Button>();
        btn_cancel = transform.Find("Obj/Btn_Cancel").GetComponent<Button>();

        //bind
        SetBtnClick(btn_ok.gameObject, "OnOkBtnClicked");
        SetBtnClick(btn_cancel.gameObject, "OnCancelBtnClicked");

    }

    protected override void InitData()
    {
        base.InitData();
    }

    protected override void DoDestroy()
    {
        base.DoDestroy();
    }

    public void OnOkBtnClicked()
    {
        Debug.Log("ok Clicked");
        TipsManager.Instance.ShowTips("这是一段测试问半天你");
    }

    public void OnCancelBtnClicked()
    {
        Debug.Log("cancel Clicked");
        UIManager.Instance.OpenUI(GlobleConfig.ResPath.UITest);
    }


}
